import redis
import os

''' 配置信息 '''
class Config(object):
    DEBUG = True
    SECRET_KEY = os.urandom(24)

    ''' 数据库配置 '''
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://test01:123456@127.0.0.1:3306/test01?charset=utf8'
    # 自动会追踪对象的修改并且发送信号
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    # 输出sql语句
    SQLALCHEMY_ECHO = False

    REDIS_HOST="127.0.0.1"
    REDIS_PORT=6379

    ''' 配置session '''
    SESSION_TYPE = 'redis'
    SESSION_PERMANENT = False
    SESSION_USE_SIGNER = False
    SESSION_PERMANENT = True
    SESSION_KEY_PREFIX = 'session:'
    SESSION_REDIS = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, retry_on_timeout=30)


# 网站配置
website = {
    # 后台配置
    "title" : "博客管理系统",

    # 前台配置
    "home_title": "我的博客"
}